package com.check.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.check.dao.PywhDao;
import com.check.pojo.Opr;
import com.check.pojo.Org;
import com.check.pojo.PromoteData;

@Repository("pywhDao")
public class PywhDaoImpl extends BaseSqlMapDao implements PywhDao{

	public List<Opr> findAllRise(Map map) {
		return getSqlMapClientTemplate().queryForList("Pywh.findRiseByPage",map);
	}

	public int findAllRiseCount(String checkYear) {
		return ((Integer)getSqlMapClientTemplate().queryForObject("Pywh.findAllRiseCount",checkYear)).intValue();
	}

	public void updateRise(String oprId) {
		updateObject("Pywh.updateRise", oprId);
	}

	public int checkPromoteData(String checkYear) {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pywh.countPromoteData",checkYear)).intValue();
	}
	
	public List<Opr> getAllRiskOpr(Opr opr){
		return getSqlMapClientTemplate().queryForList("Pywh.getAllRiseOpr",opr);
	}

	public List<Opr> getOprListByYinJianJu(String olddeptid) {
		return getSqlMapClientTemplate().queryForList("Pywh.getOprListByYinJianJu",olddeptid);
	}

	public void doInsert(PromoteData pdm) {
		insertObject("Pywh.insertPromoteData", pdm);
	}

	public void deletePromoteData(String checkYear) {
		deleteObject("Pywh.deletePromoteData", checkYear);
	}

	public List<Org> getAllRiseOrg(Opr opr) {
		return getSqlMapClientTemplate().queryForList("Pywh.getAllRiseOrg",opr);
	}

	public List<PromoteData> getPromoteData(PromoteData promoteData) {
		return getSqlMapClientTemplate().queryForList("Pywh.getPromoteData",promoteData);
		
	}

	public int getNotPromoteNum(PromoteData promoteData) {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pywh.getNotPromoteNum",promoteData)).intValue();
	}

	public void updateUploadType(Opr opr) {
		updateObject("Pywh.updateUploadType", opr);
	}

	public List<PromoteData> getPromoteDataList(PromoteData promoteData) {
		return getSqlMapClientTemplate().queryForList("Pywh.listQueryPromoteData",promoteData);
	}

	public void updateOrgPromoteData(PromoteData promoteData) {
		updateObject("Pywh.updateOrgPromoteData", promoteData);
	}
	
	public void updateOprPromoteData(PromoteData promoteData) {
		updateObject("Pywh.updateOprPromoteData", promoteData);
	}

	public List<PromoteData> getOprPromoteQueryData(Map map) {
		return getSqlMapClientTemplate().queryForList("Pywh.getOprPromoteQueryData",map);
	}

	public int getOprPromoteQueryDataCount(Map map) {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pywh.getOprPromoteQueryDataCount",map)).intValue();
	}

	public List<PromoteData> getOrgPromoteQueryData(Map map) {
		return getSqlMapClientTemplate().queryForList("Pywh.getOrgPromoteQueryData",map);
	}

	public int getOrgPromoteQueryDataCount(Map map) {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pywh.getOrgPromoteQueryDataCount", map)).intValue();
	}

	public List<PromoteData> findAllPromoteDataMemo(Map map) {
		return getSqlMapClientTemplate().queryForList("Pywh.findAllPromoteDataMemo",map);
	}

	public int findAllMarkDataMemoCount(Map map) {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pywh.findAllPromoteDataMemoCount",map)).intValue();
	}

}
